package com.wjbgn.electronicnian.enums;

import cn.hutool.core.util.RandomUtil;

/**
 * 偷饺子和学说话2选一
 *
 * @author weirx
 * @date 2022/01/21 16:54
 **/
public enum TwoChoiceOneEnum {
    DUMPLINGS(1),
    WORDS1(2),
    WORDS2(3),
    WORDS3(4),
    WORDS4(5);

    public int getCode() {
        return code;
    }

    private int code;

    TwoChoiceOneEnum(int code) {
        this.code = code;
    }

   public static TwoChoiceOneEnum getRandom(){
       int i = RandomUtil.randomInt(1, 5);
       for (TwoChoiceOneEnum t : TwoChoiceOneEnum.values()) {
           if (t.code == i){
               return t;
           }
       }
       return null;
   }
}
